// import request from '@/utils/request';
import { extend } from 'umi-request';

export type LoginParamsType = {
  username: string;
  password: string;
  mobile: string;
};

const request = extend({
  credentials: 'include', // 默认请求是否带上cookie
  headers:{
    'Content-Type': 'application/x-www-form-urlencoded',
    'authorization':`${sessionStorage.getItem('token')}`
  },
});

export async function fakeAccountLogin(params: LoginParamsType) {
  return request('/xwyl/login', {
    method: 'POST',
    requestType:'form',
    data: params,
  });
}